<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>vue计算属性</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>

</head>
<body>
<div id="app">
    <div>time:{{c1()}}</div>
    <div>time:{{c2}}</div>
</div>
</body>
<script>
    // 实例化vue对象
    new Vue({
        el:"#app",
        data:{
            timestamp:""
        },
        methods: {//方法
            c1:function () {
               return  new Date().getTime();
            }
        },
        computed:{//计算属性，可以当缓存使用
            c2:function () {
                return  new Date().getTime();
            }
        }
    });
</script>
</html>